#include <stdio.h>

int main(void)
{
	char ch;
	int n = 0;

	printf("Input some characters ending with #: ");
	scanf("%c", &ch);
	while (ch != '#')
	{
		if (ch >= 'a' && ch <= 'z' || ch >= 'A' && ch <= 'Z')
			n++;
		scanf("%c", &ch);
	}
	printf("n = %d\n", n);

	return 0;
}